{include file="header.tpl"}
<script type="text/javascript" src="./js/jquery.js"></script>
<script type="text/javascript">
function setFine()
{
  document.form1.fine.value = (parseFloat(document.form1.weight.value) * parseFloat(document.form1.touch.value))/100;
}
</script>

<form name="form1" action="" method="post">
<input type="hidden" name="veepariId" value="{$veepariId}" />
<div class="contentDiv">
  <table align="center">
  <tr>
    <td align="right">{$l_partySelect} :</td>
    <td>
      <select name="party">
        {html_options values=$party.partyId output=$party.partyName selected=$veepari.partyId}
      </select>
    </td>
  </tr>
  <tr>
    <td align="right">{$l_date} : </td>
    <td>{html_select_date prefix="curDate" start_year="-2" end_year="+1" field_order="DMY" time=$veepari.vepaariBookDate}</td>
  </tr>
  <tr>
    <td align="right">{$l_credit} / {$l_debit} : </td>
    <td>
      <select name="crdr">
        <option value="Cr">{$l_credit}</option>
        <option value="Dr">{$l_debit}</option>
      </select>
    </td>
  </tr>
  <tr>
    <td align="right">{$l_particulars} : </td>
    <td><input type="text" name="particulars" value="{$veepari.particulars}" /></td>
  </tr>
  <tr>
    <td align="right">{$l_weight} : </td>
    <td><input type="text" name="weight" value="{$veepari.weight}" /></td>
  </tr>
  <tr>
    <td align="right">{$l_touch} : </td>
    <td><input type="text" name="touch" onChange="setFine(this)" value="{$veepari.touch}" /></td>
  </tr>
  <tr>
    <td align="right">{$l_fine} : </td>
    <td><input type="text" name="fine" value="{$veepari.fine}" /></td>
  </tr>
  <tr>
    <td align="right">{$l_amount} : </td>
    <td><input type="text" name="amount" value="{$veepari.amount}" /></td>
  </tr>
  <tr>
    <td align="right"><input type="submit" name="submitBtn" value="{if $veepari|@count > 0} {$l_save} {else} {$l_add} {/if}" /></td>
    <td>{if $veepari|@count > 0} &nbsp; {else}<input type="reset" name="resetBtn" value="{$l_cancel}" />{/if}</td>
  </tr>
  </table>
</div>
</form>
<script type="text/javascript">
{if $veepari|@count > 0}
  for(var a=0 ; a < document.form1.crdr.length ; a++)
  {  
    if(document.form1.crdr[a].value == "{$veepari.CrDr}")
      document.form1.crdr[a].selected = true;
  }
{/if}
</script>
{include file="footer.tpl"}